#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    int T; cin >> T;
    while(T--){
        int a, b, c; cin >> a >> b >> c;
        int ans = INT_MAX, AA, BB, CC;
        for (int A = 1; A < 2*a; ++A) {
            for (int x = 1; x*A < 2*b; ++x) {
                int B = x*A;
                int C1 = c/B*B, C2 = c/B*B + B;
                int C = abs(C1-c) < abs(C2-c)? C1:C2;
                int now = abs(A-a)+abs(B-b)+abs(C-c);
                if(now < ans) {ans = now; AA = A, BB = B, CC = C;}
            }
        }
        cout << ans << "\n";
        cout << AA << " " << BB << " " << CC << "\n";
    }
    return 0;
}